/**  

* @author renbangjie renbangjie@126.com  
* @version V1.0  
*/
package com.ai.service.reviewed.service.impl;

import java.io.InputStream;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;

import com.ai.common.core.base.DTO;
import com.ai.common.core.mapper.Mapper;
import com.ai.common.core.pager.model.PagerUtil;
import com.ai.common.core.pager.service.IPagerService;
import com.ai.common.core.service.impl.BaseServiceImpl;
import com.ai.common.core.utils.CollectionUtils;
import com.ai.common.model.Pagination;
import com.ai.mmd.reviewed.dto.JzxhginfoDTO;
import com.ai.mmd.reviewed.dto.JzxslinfoDTO;
import com.ai.mmd.reviewed.dto.JzxtlinfoDTO;
import com.ai.mmd.reviewed.dto.SbhzinfoDTO;
import com.ai.mmd.reviewed.dto.SbmxinfoDTO;
import com.ai.mmd.reviewed.dto.YhxxDTO;
import com.ai.mmd.reviewed.vo.JzxhginfoVO;
import com.ai.mmd.reviewed.vo.JzxslinfoVO;
import com.ai.mmd.reviewed.vo.JzxtlinfoVO;
import com.ai.mmd.reviewed.vo.SbmxinfoVO;
import com.ai.mmd.system.dto.GkinfoDTO;
import com.ai.mmd.system.dto.HwlxinfoDTO;
import com.ai.mmd.system.dto.XxinfoDTO;
import com.ai.mmd.system.dto.ZdinfoDTO;
import com.ai.mmd.system.vo.GkinfoVO;
import com.ai.mmd.system.vo.HwlxinfoVO;
import com.ai.mmd.system.vo.XxinfoVO;
import com.ai.mmd.system.vo.ZdinfoVO;
import com.ai.service.reviewed.dao.SbmxinfoModelMapper;
import com.ai.service.reviewed.dao.YhxxModelMapper;
import com.ai.service.reviewed.dao.JzxhginfoModelMapper;
import com.ai.service.reviewed.dao.JzxslinfoModelMapper;
import com.ai.service.reviewed.dao.JzxtlinfoModelMapper;
import com.ai.service.reviewed.dao.SbhzinfoModelMapper;
import com.ai.service.reviewed.model.JzxhginfoModel;
import com.ai.service.reviewed.model.JzxslinfoModel;
import com.ai.service.reviewed.model.JzxtlinfoModel;
import com.ai.service.reviewed.model.SbhzinfoModel;
import com.ai.service.reviewed.model.SbmxinfoModel;
import com.ai.service.reviewed.model.YhxxModel;
import com.ai.service.reviewed.service.ISbmxinfoService;
import com.ai.service.system.dao.GkinfoModelMapper;
import com.ai.service.system.dao.HwlxinfoModelMapper;
import com.ai.service.system.dao.XxinfoModelMapper;
import com.ai.service.system.dao.ZdinfoModelMapper;
import com.ai.service.system.model.GkinfoModel;
import com.ai.service.system.model.HwlxinfoModel;
import com.ai.service.system.model.XxinfoModel;
import com.ai.service.system.model.ZdinfoModel;

/**
* 
*	登陆信息的业务实现类
* 
* @author renbangjie renbangjie@126.com
*/
@Service("isbmxinfoService")
public class SbmxinfoServiceImpl extends BaseServiceImpl<SbmxinfoModel>
		implements ISbmxinfoService {
	
	@Transactional(rollbackFor = Exception.class)
    public Map<String, String> readXlsx(InputStream is,SbhzinfoDTO sbhzinfoDTO) throws Exception {
		
		Map<String, String> map = new HashMap<String, String>();
		String nret = "0";
		
		XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
		
		//获取sequence
  		String key = "";
        
        if (sbhzinfoDTO.getHzdh()==null) {
			//新增汇总
        	key = sbhzinfoModelMapper.getSequence("btdh");
        	// 插入汇总表
      		sbhzinfoDTO.setHzdh(key);
    		sbhzinfoDTO.setCjsj(new Date());
    		sbhzinfoDTO.setGxsj(new Date());
    		SbhzinfoModel sbhzinfoModel = new SbhzinfoModel();
    		BeanUtils.copyProperties(sbhzinfoDTO, sbhzinfoModel);
    		sbhzinfoModelMapper.insert(sbhzinfoModel);
		}else {
			key = sbhzinfoDTO.getHzdh();
		}
        
        //插入明細表
        SbmxinfoDTO sbmxinfoDTO = null;
        SbmxinfoModel sbmxinfoModel = null;
        
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date = null;
        
      //查询数据字段获取集合
        HwlxinfoDTO hwlxinfoDTO = new HwlxinfoDTO();
        hwlxinfoDTO.setSfsc(0);
        Map<String, HwlxinfoModel> hwlxMap = CollectionUtils
                .toMap(hwlxinfoModelMapper.getList(hwlxinfoDTO), "hwlxmc");
        
        XxinfoDTO xxinfoDTO = new XxinfoDTO();
        xxinfoDTO.setSfsc(0);
        Map<String, XxinfoModel> xxMap = CollectionUtils
                .toMap(xxinfoModelMapper.getList(xxinfoDTO), "xxmc");
        
        ZdinfoDTO zdinfoDTO = new ZdinfoDTO();
        zdinfoDTO.setSfsc(0);
        Map<String, ZdinfoModel> zdMap = CollectionUtils
                .toMap(zdinfoModelMapper.getList(zdinfoDTO), "zdmc");
        
        GkinfoDTO gkinfoDTO = new GkinfoDTO();
        gkinfoDTO.setSfsc(0);
        Map<String, GkinfoModel> gkMap = CollectionUtils
                .toMap(gkinfoModelMapper.getList(gkinfoDTO), "gkmc");
 
        // 循环工作表Sheet
        for (int numSheet = 0; numSheet < xssfWorkbook.getNumberOfSheets(); numSheet++) {
            XSSFSheet hssfSheet = xssfWorkbook.getSheetAt(numSheet);
            if (hssfSheet == null) {
                continue;
            }
 
            // 循环行Row
            for (int rowNum = 3; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
                XSSFRow hssfRow = hssfSheet.getRow(rowNum);
                if (hssfRow == null) {
                    continue;
                }
                
                if(parseExcel(hssfRow.getCell(2))==null||parseExcel(hssfRow.getCell(2)).equals("")){
                	continue;
                }
                
                sbmxinfoDTO = new SbmxinfoDTO();
                sbmxinfoDTO.setHzdh(key);
 
                // 循环列Cell
                for (int cellNum = 1; cellNum <= hssfRow.getLastCellNum(); cellNum++) {
                    XSSFCell hssfCell = hssfRow.getCell(cellNum);
//                    if (hssfCell == null) {
//                        continue;
//                    }
                    String currentValue = parseExcel(hssfCell);
                    if (currentValue!=null) {
                    	currentValue = currentValue.trim();
					}
                    switch (cellNum) {
                    case 1:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"运输类型必填");
							map.put("nret", nret);
							return map;
						}
						if ("铁水".equals(currentValue)) {
							sbmxinfoDTO.setYslx(1);
						}else {
							sbmxinfoDTO.setYslx(2);
						}
						break;
					case 2:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"贸易类型必填");
							map.put("nret", nret);
							return map;
						}
						if ("内贸".equals(currentValue)) {
							sbmxinfoDTO.setMylx(1);
						}else {
							sbmxinfoDTO.setMylx(2);
						}
						break;
					case 3:				
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"箱号必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"箱号长度不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setXh(currentValue);
						break;
					case 4:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"货物类型必填");
							map.put("nret", nret);
							return map;
						}
						if (!hwlxMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"货物类型没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHwlx(hwlxMap.get(currentValue).getId());
						break;
//					case 5:
//						if (currentValue==null||currentValue=="") {
//							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//							nret = getReturnMessage(rowNum,"货物名称必填");
//							map.put("nret", nret);
//							return map;
//						}
//						if (currentValue.length()>20) {
//							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//							nret = getReturnMessage(rowNum,"货物名称长度不能大于20位");
//							map.put("nret", nret);
//							return map;
//						}
//						sbmxinfoDTO.setHwmc(currentValue);
//						break;
					case 5:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"箱型必填");
							map.put("nret", nret);
							return map;
						}
						if (!xxMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"箱型没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setXx(xxMap.get(currentValue).getId());
						break;
					case 6:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"出/入铁路站场时间必填");
							map.put("nret", nret);
							return map;
						}
						try {
							date = sdf.parse(currentValue);
						} catch (Exception e) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"出/入铁路站场时间格式不正确,应如:2016-01-01");
							map.put("nret", nret);
							return map;
						}	
						sbmxinfoDTO.setCrtlsj(date);
						break;
					case 7:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"铁路货票号必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"铁路货票号长度不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setTlhph(currentValue);
						break;
					case 8:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"发站必填");
							map.put("nret", nret);
							return map;
						}
						if (!zdMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"站点没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setFz(zdMap.get(currentValue).getId());
						break;
					case 9:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"到站必填");
							map.put("nret", nret);
							return map;
						}
						if (!zdMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"站点没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setDz(zdMap.get(currentValue).getId());
						break;
					case 10:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"出/入港口时间必填");
							map.put("nret", nret);
							return map;
						}
						try {
							date = sdf.parse(currentValue);
						} catch (Exception e) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"出/入港口时间格式不正确,应如:2016-01-01");
							map.put("nret", nret);
							return map;
						}	
						sbmxinfoDTO.setCrgksj(date);
						break;
					case 11:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"货物运单号必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"货物运单号长度不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHwydh(currentValue);
						break;
//					case 13:
//						if (currentValue.length()>20) {
//							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//							nret = getReturnMessage(rowNum,"封号长度不能大于20位");
//							map.put("nret", nret);
//							return map;
//						}
//						sbmxinfoDTO.setFh(currentValue);
//						break;
					case 12:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"船名必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>30) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"船名长度不能大于30位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setCm(currentValue);
						break;
					case 13:
						if (currentValue.length()>10) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"航次长度不能大于10位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHc(currentValue);
						break;
					case 14:
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"MMSI号长度不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setMmsi(currentValue);
						break;
					case 15:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"船舶到港必填");
							map.put("nret", nret);
							return map;
						}
						if (!gkMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"港口没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setCbdg(gkMap.get(currentValue).getId());
						break;
					case 16:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"船舶离港必填");
							map.put("nret", nret);
							return map;
						}
						if (!gkMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"港口没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setCblg(gkMap.get(currentValue).getId());
						break;
					case 17:
						if (currentValue.length()>100) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"备注不能大于100位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setBz(currentValue);
						break;
					/*case 18:
						if (sbmxinfoDTO.getMylx()!=2) {
							break;
						}
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"海关申报单号不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHgsbdh(currentValue);
						break;*/
					case 18:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"铁路照片必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>100) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"铁路图片名称不能大于100位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setTlzpmc(currentValue);
						break;
					case 19:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"水路照片必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>100) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"水路图片名称不能大于100位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setSlzpmc(currentValue);
						break;
					case 20:
						if (sbmxinfoDTO.getMylx()!=2) {
							break;
						}
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"海关照片必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>100) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"海关图片名称不能大于100位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHgzpmc(currentValue);
						break;
					default:
						break;
					}
                }
                sbmxinfoModel = sbmxinfoModelMapper.getOne(sbmxinfoDTO);
                if (sbmxinfoModel!=null) {
					continue;
				}
                sbmxinfoDTO.setCjsj(new Date());
                sbmxinfoDTO.setGxsj(new Date());
                sbmxinfoModel = new SbmxinfoModel();
                BeanUtils.copyProperties(sbmxinfoDTO, sbmxinfoModel);
                sbmxinfoModelMapper.insert(sbmxinfoModel);
            }
        }
        
        map.put("nret", nret);
        map.put("hzdh", key);
		return map;
    }
	
	@Transactional(rollbackFor = Exception.class)
    public Map<String, String> readXls(InputStream is,SbhzinfoDTO sbhzinfoDTO) throws Exception {
		Map<String, String> map = new HashMap<String, String>();
		
        HSSFWorkbook hssfWorkbook = new HSSFWorkbook(is);
        
        String nret = "0";
        
        //获取sequence
  		String key = "";
        
        if (sbhzinfoDTO.getHzdh()==null) {
			//新增汇总
        	key = sbhzinfoModelMapper.getSequence("btdh");
        	// 插入汇总表
      		sbhzinfoDTO.setHzdh(key);
    		sbhzinfoDTO.setCjsj(new Date());
    		sbhzinfoDTO.setGxsj(new Date());
    		SbhzinfoModel sbhzinfoModel = new SbhzinfoModel();
    		BeanUtils.copyProperties(sbhzinfoDTO, sbhzinfoModel);
    		sbhzinfoModelMapper.insert(sbhzinfoModel);
		}else {
			key = sbhzinfoDTO.getHzdh();
		}
        
		//插入明細表
		SbmxinfoDTO sbmxinfoDTO = null;
		SbmxinfoModel sbmxinfoModel = null;
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date = null;
        
        //查询数据字段获取集合
        HwlxinfoDTO hwlxinfoDTO = new HwlxinfoDTO();
        hwlxinfoDTO.setSfsc(0);
        Map<String, HwlxinfoModel> hwlxMap = CollectionUtils
                .toMap(hwlxinfoModelMapper.getList(hwlxinfoDTO), "hwlxmc");
        
        XxinfoDTO xxinfoDTO = new XxinfoDTO();
        xxinfoDTO.setSfsc(0);
        Map<String, XxinfoModel> xxMap = CollectionUtils
                .toMap(xxinfoModelMapper.getList(xxinfoDTO), "xxmc");
        
        ZdinfoDTO zdinfoDTO = new ZdinfoDTO();
        zdinfoDTO.setSfsc(0);
        Map<String, ZdinfoModel> zdMap = CollectionUtils
                .toMap(zdinfoModelMapper.getList(zdinfoDTO), "zdmc");
        
        GkinfoDTO gkinfoDTO = new GkinfoDTO();
        gkinfoDTO.setSfsc(0);
        Map<String, GkinfoModel> gkMap = CollectionUtils
                .toMap(gkinfoModelMapper.getList(gkinfoDTO), "gkmc");
 
        // 循环工作表Sheet
        for (int numSheet = 0; numSheet < hssfWorkbook.getNumberOfSheets(); numSheet++) {
            HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(numSheet);
            if (hssfSheet == null) {
                continue;
            }
 
            // 循环行Row
            for (int rowNum = 3; rowNum <= hssfSheet.getLastRowNum(); rowNum++) {
                HSSFRow hssfRow = hssfSheet.getRow(rowNum);
                if (hssfRow == null) {
                    continue;
                }
                
                if(parseExcel(hssfRow.getCell(2))==null||parseExcel(hssfRow.getCell(2)).equals("")){
                	continue;
                }
                
                sbmxinfoDTO = new SbmxinfoDTO();
                sbmxinfoDTO.setHzdh(key);
 
                // 循环列Cell
                for (int cellNum = 1; cellNum <= hssfRow.getLastCellNum(); cellNum++) {
                    HSSFCell hssfCell = hssfRow.getCell(cellNum);
//                    if (hssfCell == null) {
//                        continue;
//                    }
                    String currentValue = parseExcel(hssfCell);
                    if (currentValue!=null) {
                    	currentValue = currentValue.trim();
					}
                    switch (cellNum) {
					case 1:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"运输类型必填");
							map.put("nret", nret);
							return map;
						}
						if ("铁水".equals(currentValue)) {
							sbmxinfoDTO.setYslx(1);
						}else {
							sbmxinfoDTO.setYslx(2);
						}
						break;
					case 2:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"贸易类型必填");
							map.put("nret", nret);
							return map;
						}
						if ("内贸".equals(currentValue)) {
							sbmxinfoDTO.setMylx(1);
						}else {
							sbmxinfoDTO.setMylx(2);
						}
						break;
					case 3:				
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"箱号必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"箱号长度不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setXh(currentValue);
						break;
					case 4:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"货物类型必填");
							map.put("nret", nret);
							return map;
						}
						if (!hwlxMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"货物类型没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHwlx(hwlxMap.get(currentValue).getId());
						break;
//					case 5:
//						if (currentValue==null||currentValue=="") {
//							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//							nret = getReturnMessage(rowNum,"货物名称必填");
//							map.put("nret", nret);
//							return map;
//						}
//						if (currentValue.length()>20) {
//							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//							nret = getReturnMessage(rowNum,"货物名称长度不能大于20位");
//							map.put("nret", nret);
//							return map;
//						}
//						sbmxinfoDTO.setHwmc(currentValue);
//						break;
					case 5:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"箱型必填");
							map.put("nret", nret);
							return map;
						}
						if (!xxMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"箱型没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setXx(xxMap.get(currentValue).getId());
						break;
					case 6:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"出/入铁路站场时间必填");
							map.put("nret", nret);
							return map;
						}
						try {
							date = sdf.parse(currentValue);
						} catch (Exception e) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"出/入铁路站场时间格式不正确,应如:2016-01-01");
							map.put("nret", nret);
							return map;
						}	
						sbmxinfoDTO.setCrtlsj(date);
						break;
					case 7:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"铁路货票号必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"铁路货票号长度不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setTlhph(currentValue);
						break;
					case 8:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"发站必填");
							map.put("nret", nret);
							return map;
						}
						if (!zdMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"站点没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setFz(zdMap.get(currentValue).getId());
						break;
					case 9:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"到站必填");
							map.put("nret", nret);
							return map;
						}
						if (!zdMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"站点没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setDz(zdMap.get(currentValue).getId());
						break;
					case 10:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"出/入港口时间必填");
							map.put("nret", nret);
							return map;
						}
						try {
							date = sdf.parse(currentValue);
						} catch (Exception e) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"出/入港口时间格式不正确,应如:2016-01-01");
							map.put("nret", nret);
							return map;
						}	
						sbmxinfoDTO.setCrgksj(date);
						break;
					case 11:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"货物运单号必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"货物运单号长度不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHwydh(currentValue);
						break;
//					case 13:
//						if (currentValue.length()>20) {
//							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//							nret = getReturnMessage(rowNum,"封号长度不能大于20位");
//							map.put("nret", nret);
//							return map;
//						}
//						sbmxinfoDTO.setFh(currentValue);
//						break;
					case 12:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"船名必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>30) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"船名长度不能大于30位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setCm(currentValue);
						break;
					case 13:
						if (currentValue.length()>10) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"航次长度不能大于10位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHc(currentValue);
						break;
					case 14:
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"MMSI号长度不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setMmsi(currentValue);
						break;
					case 15:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"船舶到港必填");
							map.put("nret", nret);
							return map;
						}
						if (!gkMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"港口没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setCbdg(gkMap.get(currentValue).getId());
						break;
					case 16:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"船舶离港必填");
							map.put("nret", nret);
							return map;
						}
						if (!gkMap.containsKey(currentValue)) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,currentValue+"港口没维护");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setCblg(gkMap.get(currentValue).getId());
						break;
					case 17:
						if (currentValue.length()>100) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"备注不能大于100位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setBz(currentValue);
						break;
					/*case 18:
						if (sbmxinfoDTO.getMylx()!=2) {
							break;
						}
						if (currentValue.length()>20) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"海关申报单号不能大于20位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHgsbdh(currentValue);
						break;*/
					case 18:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"铁路照片必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>100) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"铁路图片名称不能大于100位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setTlzpmc(currentValue);
						break;
					case 19:
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"水路照片必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>100) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"水路图片名称不能大于100位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setSlzpmc(currentValue);
						break;
					case 20:
						if (sbmxinfoDTO.getMylx()!=2) {
							break;
						}
						if (currentValue==null||currentValue=="") {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"海关照片必填");
							map.put("nret", nret);
							return map;
						}
						if (currentValue.length()>100) {
							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
							nret = getReturnMessage(rowNum,"海关图片名称不能大于100位");
							map.put("nret", nret);
							return map;
						}
						sbmxinfoDTO.setHgzpmc(currentValue);
						break;
					default:
						break;
					}
                }
                sbmxinfoModel = sbmxinfoModelMapper.getOne(sbmxinfoDTO);
                if (sbmxinfoModel!=null) {
					continue;
				}
                sbmxinfoDTO.setCjsj(new Date());
                sbmxinfoDTO.setGxsj(new Date());
                sbmxinfoModel = new SbmxinfoModel();
                BeanUtils.copyProperties(sbmxinfoDTO, sbmxinfoModel);
                sbmxinfoModelMapper.insert(sbmxinfoModel);
            }
        }
        map.put("nret", nret);
        map.put("hzdh", key);
		return map;
    }
 
    private String parseExcel(Cell cell) {  
        String result = new String();
        if (cell==null) {
			return "";
		}
        switch (cell.getCellType()) {  
        case HSSFCell.CELL_TYPE_NUMERIC:// 数字类型  
            if (HSSFDateUtil.isCellDateFormatted(cell)) {// 处理日期格式、时间格式  
                SimpleDateFormat sdf = null;  
                if (cell.getCellStyle().getDataFormat() == HSSFDataFormat  
                        .getBuiltinFormat("h:mm")) {  
                    sdf = new SimpleDateFormat("HH:mm");  
                } else {// 日期  
                    sdf = new SimpleDateFormat("yyyy-MM-dd");  
                }  
                Date date = cell.getDateCellValue();  
                result = sdf.format(date);  
            }  else {  
                double value = cell.getNumericCellValue();  
                CellStyle style = cell.getCellStyle();  
                DecimalFormat format = new DecimalFormat();  
                String temp = style.getDataFormatString();  
                // 单元格设置成常规  
                if (temp.equals("General")) {  
                    format.applyPattern("#");  
                }  
                result = format.format(value);  
            }  
            break;  
        case HSSFCell.CELL_TYPE_STRING:// String类型  
            result = cell.getRichStringCellValue().toString();  
            break;  
        case HSSFCell.CELL_TYPE_BLANK:  
            result = "";  
        default:  
            result = "";  
            break;  
        }  
        return result;  
    }
    
    private String getReturnMessage(Integer rowNum,String errMessage) {
		return "第"+String.valueOf(rowNum)+"行数据," + errMessage + ",请核对后重新上传!";
	}
    
    /**
     * 详细信息的分页
     *
     * @param yhxxDTO
     * @return
     * @throws Exception
     */
    @Override
    public Pagination<SbmxinfoVO> getListVO(SbmxinfoDTO sbmxinfoDTO,final String baseFolder) throws Exception {
        return PagerUtil.getPagination(new IPagerService<SbmxinfoVO>() {
            @Override
            public int queryCount(DTO dto) throws Exception {
                return getMapper().getListCount(dto);
            }

            @Override
            public List<SbmxinfoVO> queryList(DTO dto) throws Exception {
                List<SbmxinfoVO> voList = new ArrayList<SbmxinfoVO>();
                List<SbmxinfoModel> shmxList = getMapper().getList(dto);
                if (shmxList.isEmpty()) {
                    return voList;
                }
                //货物类型
                HwlxinfoDTO hwlxDTO = new HwlxinfoDTO();
                List<Integer> hwlxList = CollectionUtils
                        .getBeanFieldValues(shmxList, "hwlx");
                hwlxDTO.setIdList(hwlxList);
                Map<Integer, HwlxinfoModel> hwlxMap = CollectionUtils
                        .toMap(hwlxinfoModelMapper.getList(hwlxDTO), "id");
                
                //箱型
                XxinfoDTO xxinfoDTO = new XxinfoDTO();
                List<Integer> xxList = CollectionUtils
                        .getBeanFieldValues(shmxList, "xx");
                xxinfoDTO.setIdList(xxList);
                Map<Integer, XxinfoModel> xxMap = CollectionUtils
                        .toMap(xxinfoModelMapper.getList(xxinfoDTO), "id");
                
                //港口
                GkinfoDTO gkinfoDTO = new GkinfoDTO();
                List<Integer> gkList = CollectionUtils
                        .getBeanFieldValues(shmxList, "cbdg","cblg");
                gkinfoDTO.setIdList(gkList);
                Map<Integer, GkinfoModel> gkMap = CollectionUtils
                        .toMap(gkinfoModelMapper.getList(gkinfoDTO), "id");
                
                //站点
                ZdinfoDTO zdinfoDTO = new ZdinfoDTO();
                List<Integer> zdList = CollectionUtils
                        .getBeanFieldValues(shmxList, "fz","dz");
                zdinfoDTO.setIdList(zdList);
                Map<Integer, ZdinfoModel> zdMap = CollectionUtils
                        .toMap(zdinfoModelMapper.getList(zdinfoDTO), "id");

                SbmxinfoVO sbmxinfoVO = null;
                HwlxinfoVO hwlxinfoVO = null;
                XxinfoVO xxinfoVO = null;
                GkinfoVO cbdginfoVO = null;
                GkinfoVO cblginfoVO = null;
                ZdinfoVO fzinfoVO = null;
                ZdinfoVO dzinfoVO = null;
                JzxtlinfoVO jzxtlinfoVO = null;
                JzxslinfoVO jzxslinfoVO = null;
                JzxhginfoVO jzxhginfoVO = null;

                for (SbmxinfoModel sbmxinfoModel : shmxList) {
                	sbmxinfoVO = new SbmxinfoVO();
                    BeanUtils.copyProperties(sbmxinfoModel, sbmxinfoVO);
                    
                    SbhzinfoDTO sbhzinfoDTO = new SbhzinfoDTO();
                    sbhzinfoDTO.setHzdh(sbmxinfoVO.getHzdh());
                    SbhzinfoModel sbhzinfoModel = sbhzinfoModelMapper.getOne(sbhzinfoDTO);
                    //企业名称 
                    YhxxModel yhxxModel = yhxxModelMapper.getOne(new YhxxDTO(sbhzinfoModel.getYhid()));
                    sbmxinfoVO.setQyqc(yhxxModel.getQyqc());
                    
                    //申报年份
                    Integer sbnf = sbhzinfoModel.getSbnf();
                    sbmxinfoVO.setSbnf(sbnf);
                    
                    //申报季度
                    Integer sbjd = sbhzinfoModel.getSbjd();
                    sbmxinfoVO.setSbjd(sbjd);
                    
                    //运输类型
                    if (sbmxinfoVO.getYslx()==1) {
                    	sbmxinfoVO.setYslxStr("铁水");
					}else {
						sbmxinfoVO.setYslxStr("水铁");
					}
                    
                    //贸易类型
                    if (sbmxinfoVO.getMylx()==1) {
                    	sbmxinfoVO.setMylxStr("内贸");
					}else {
						sbmxinfoVO.setMylxStr("外贸");
					}
                    
                    //货物类型
                    if (hwlxMap != null && !hwlxMap.isEmpty() && hwlxMap
                            .containsKey(sbmxinfoModel.getHwlx())) {
                    	hwlxinfoVO = new HwlxinfoVO();
                        BeanUtils.copyProperties(hwlxMap.get(sbmxinfoModel.getHwlx()),
                        		hwlxinfoVO);
                        sbmxinfoVO.setHwlxinfoVO(hwlxinfoVO);
                    }
                    //箱型
                    if (xxMap != null && !xxMap.isEmpty() && xxMap
                            .containsKey(sbmxinfoModel.getXx())) {
                    	xxinfoVO = new XxinfoVO();
                        BeanUtils.copyProperties(xxMap.get(sbmxinfoModel.getXx()),
                        		xxinfoVO);
                        sbmxinfoVO.setXxinfoVO(xxinfoVO);
                    }
                 	//港口
                    if (gkMap != null && !gkMap.isEmpty() && gkMap
                            .containsKey(sbmxinfoModel.getCbdg()) && gkMap
                            .containsKey(sbmxinfoModel.getCblg())) {
                    	cbdginfoVO = new GkinfoVO();
                    	cblginfoVO = new GkinfoVO();
                        BeanUtils.copyProperties(gkMap.get(sbmxinfoModel.getCbdg()),
                        		cbdginfoVO);
                        BeanUtils.copyProperties(gkMap.get(sbmxinfoModel.getCblg()),
                        		cblginfoVO);
                        sbmxinfoVO.setCbdginfoVO(cbdginfoVO);
                        sbmxinfoVO.setCblginfoVO(cblginfoVO);
                    }
                    //站点
                    if (zdMap != null && !zdMap.isEmpty() && zdMap
                            .containsKey(sbmxinfoModel.getFz()) && zdMap
                            .containsKey(sbmxinfoModel.getDz())) {
                    	fzinfoVO = new ZdinfoVO();
                    	dzinfoVO = new ZdinfoVO();
                        BeanUtils.copyProperties(zdMap.get(sbmxinfoModel.getFz()),
                        		fzinfoVO);
                        BeanUtils.copyProperties(zdMap.get(sbmxinfoModel.getDz()),
                        		dzinfoVO);
                        sbmxinfoVO.setFzinfoVO(fzinfoVO);
                        sbmxinfoVO.setDzinfoVO(dzinfoVO);
                    }
                    
                    //铁路图片
                    String tlzpUrl = baseFolder + yhxxModel.getYhid() + "/" + sbnf + sbjd + "/" + sbmxinfoVO.getTlzpmc() + ".jpg";
                    sbmxinfoVO.setTlzpmc(tlzpUrl);
                    //水路图片
                    String slzpUrl = baseFolder + yhxxModel.getYhid() + "/" + sbnf + sbjd + "/" + sbmxinfoVO.getSlzpmc() + ".jpg";
                    sbmxinfoVO.setSlzpmc(slzpUrl);
                    if (sbmxinfoVO.getMylx()==2) {
                    	//海关图片
                        String hgzpUrl = baseFolder + yhxxModel.getYhid() + "/" + sbnf + sbjd + "/" + sbmxinfoVO.getHgzpmc() + ".jpg";
                        sbmxinfoVO.setHgzpmc(hgzpUrl);
                    }
                    
                    
//                    //货票附件
//                    JzxtlinfoDTO jzxtlinfoDTO = new JzxtlinfoDTO();
//                    jzxtlinfoDTO.setSfsc(0);
//                    jzxtlinfoDTO.setHph(sbmxinfoModel.getTlhph());
//                    JzxtlinfoModel jzxtlinfoModel = jzxtlinfoModelMapper.getOne(jzxtlinfoDTO);
//                    if (jzxtlinfoModel!=null) {
//						jzxtlinfoVO = new JzxtlinfoVO();
//						BeanUtils.copyProperties(jzxtlinfoModel,jzxtlinfoVO);
//						sbmxinfoVO.setJzxtlinfoVO(jzxtlinfoVO);
//					}
//                    //运单附件
//                    JzxslinfoDTO jzxslinfoDTO = new JzxslinfoDTO();
//                    jzxslinfoDTO.setSfsc(0);
//                    jzxslinfoDTO.setTdh(sbmxinfoModel.getHwydh());
//                    JzxslinfoModel jzxslinfoModel = jzxslinfoModelMapper.getOne(jzxslinfoDTO);
//                    if (jzxslinfoModel!=null) {
//						jzxslinfoVO = new JzxslinfoVO();
//						BeanUtils.copyProperties(jzxslinfoModel,jzxslinfoVO);
//						sbmxinfoVO.setJzxslinfoVO(jzxslinfoVO);
//					}
//                    if (sbmxinfoVO.getMylx()==2) {
//                    	//海关附件
//                        JzxhginfoDTO jzxhginfoDTO = new JzxhginfoDTO();
//                        jzxhginfoDTO.setSfsc(0);
//                        jzxhginfoDTO.setHgsbdh(sbmxinfoModel.getHgsbdh());
//                        JzxhginfoModel jzxhginfoModel = jzxhginfoModelMapper.getOne(jzxhginfoDTO);
//                        if (jzxhginfoModel!=null) {
//    						jzxhginfoVO = new JzxhginfoVO();
//    						BeanUtils.copyProperties(jzxhginfoModel,jzxhginfoVO);
//    						sbmxinfoVO.setJzxhginfoVO(jzxhginfoVO);
//    					}
//					}
     
                    voList.add(sbmxinfoVO);
                }
                return voList;
            }
        }, sbmxinfoDTO);
    }
    
    /**
     * 获取一个明细VO
     *
     * @param SbmxinfoDTO
     * @return
     * @throws Exception
     */
    public SbmxinfoVO getVO(SbmxinfoDTO sbmxinfoDTO) throws Exception {
        
    	SbmxinfoVO sbmxinfoVO = null;
    	HwlxinfoVO hwlxinfoVO = null;
        XxinfoVO xxinfoVO = null;
        GkinfoVO cbdginfoVO = null;
        GkinfoVO cblginfoVO = null;
        ZdinfoVO fzinfoVO = null;
        ZdinfoVO dzinfoVO = null;
        JzxtlinfoVO jzxtlinfoVO = null;
        JzxslinfoVO jzxslinfoVO = null;
        
        SbmxinfoModel sbmxinfoModel = getMapper().getOne(sbmxinfoDTO);
        if (sbmxinfoModel==null) {
            return sbmxinfoVO;
        }
        //货物类型
        HwlxinfoModel hwlxinfoModel = hwlxinfoModelMapper.getByPrimaryKey(sbmxinfoModel.getHwlx());        
        //箱型
        XxinfoModel xxinfoModel = xxinfoModelMapper.getByPrimaryKey(sbmxinfoModel.getXx());
        //港口
        GkinfoModel cbdgGkModel = gkinfoModelMapper.getByPrimaryKey(sbmxinfoModel.getCbdg());
        GkinfoModel cblgGkModel = gkinfoModelMapper.getByPrimaryKey(sbmxinfoModel.getCblg());
        //站点
        ZdinfoModel fzinfoModel = zdinfoModelMapper.getByPrimaryKey(sbmxinfoModel.getFz());
        ZdinfoModel dzinfoModel = zdinfoModelMapper.getByPrimaryKey(sbmxinfoModel.getDz());
        //货票附件
        JzxtlinfoDTO jzxtlinfoDTO = new JzxtlinfoDTO();
        jzxtlinfoDTO.setSfsc(0);
        jzxtlinfoDTO.setHph(sbmxinfoModel.getTlhph());
        JzxtlinfoModel jzxtlinfoModel = jzxtlinfoModelMapper.getOne(jzxtlinfoDTO);
        //运单附件
        JzxslinfoDTO jzxslinfoDTO = new JzxslinfoDTO();
        jzxslinfoDTO.setSfsc(0);
        jzxslinfoDTO.setTdh(sbmxinfoModel.getHwydh());
        JzxslinfoModel jzxslinfoModel = jzxslinfoModelMapper.getOne(jzxslinfoDTO);

        sbmxinfoVO = new SbmxinfoVO();
        hwlxinfoVO = new HwlxinfoVO();
        xxinfoVO = new XxinfoVO();
        cbdginfoVO = new GkinfoVO();
        cblginfoVO = new GkinfoVO();
        fzinfoVO = new ZdinfoVO();
        dzinfoVO = new ZdinfoVO();
        jzxtlinfoVO = new JzxtlinfoVO();
        jzxslinfoVO = new JzxslinfoVO();
        
        BeanUtils.copyProperties(sbmxinfoModel, sbmxinfoVO);
        //货物类型
        BeanUtils.copyProperties(hwlxinfoModel,hwlxinfoVO);
        sbmxinfoVO.setHwlxinfoVO(hwlxinfoVO);
        //箱型
        BeanUtils.copyProperties(xxinfoModel,xxinfoVO);
        sbmxinfoVO.setXxinfoVO(xxinfoVO);
        //港口
        BeanUtils.copyProperties(cbdgGkModel,cbdginfoVO);
        BeanUtils.copyProperties(cblgGkModel,cblginfoVO);
        sbmxinfoVO.setCbdginfoVO(cbdginfoVO);
        sbmxinfoVO.setCblginfoVO(cblginfoVO);
        //站点
        BeanUtils.copyProperties(fzinfoModel,fzinfoVO);
        BeanUtils.copyProperties(dzinfoModel,dzinfoVO);
        sbmxinfoVO.setFzinfoVO(fzinfoVO);
        sbmxinfoVO.setDzinfoVO(dzinfoVO);
        //附件
        if (jzxtlinfoModel!=null) {
        	BeanUtils.copyProperties(jzxtlinfoModel,jzxtlinfoVO);
        	sbmxinfoVO.setJzxtlinfoVO(jzxtlinfoVO);
		}
        if (jzxslinfoModel!=null) {
        	BeanUtils.copyProperties(jzxslinfoModel,jzxslinfoVO);
        	sbmxinfoVO.setJzxslinfoVO(jzxslinfoVO);
		}
        return sbmxinfoVO;
    }
    
    /**
     * 查询未绑定的货运运单号列表
     *
     * @param SbmxinfoDTO
     * @return
     * @throws Exception
     */
    public List<SbmxinfoModel> getUnbindhwydhList(SbmxinfoDTO sbmxinfoDTO) throws Exception{
    	return sbmxinfoModelMapper.getUnbindhwydhList(sbmxinfoDTO);
    }
    
    /**
     * 查询未绑定的铁路货票号列表
     *
     * @param SbmxinfoDTO
     * @return
     * @throws Exception
     */
    public List<SbmxinfoModel> getUnbindtlhphList(SbmxinfoDTO sbmxinfoDTO) throws Exception{
    	return sbmxinfoModelMapper.getUnbindtlhphList(sbmxinfoDTO);
    }
    
    /**
     * 查询未绑定的海关号列表
     *
     * @param SbmxinfoDTO
     * @return
     * @throws Exception
     */
    public List<SbmxinfoModel> getUnbindhgsbList(SbmxinfoDTO sbmxinfoDTO) throws Exception{
    	return sbmxinfoModelMapper.getUnbindhgsbList(sbmxinfoDTO);
    }
    
    /**
     * 获得比对有质疑的明细列表
     * @param SbhzinfoDTO
     * @return
     * @throws Exception
     */
    public List<SbmxinfoVO> getCompareWorngList(SbhzinfoDTO sbhzinfoDTO) throws Exception {
        List<SbmxinfoVO> voList = new ArrayList<SbmxinfoVO>();
        List<SbmxinfoModel> shmxList = sbhzinfoModelMapper.getCompareWorngList(sbhzinfoDTO);
        if (shmxList.isEmpty()) {
            return voList;
        }
        //货物类型
        HwlxinfoDTO hwlxDTO = new HwlxinfoDTO();
        List<Integer> hwlxList = CollectionUtils
                .getBeanFieldValues(shmxList, "hwlx");
        hwlxDTO.setIdList(hwlxList);
        Map<Integer, HwlxinfoModel> hwlxMap = CollectionUtils
                .toMap(hwlxinfoModelMapper.getList(hwlxDTO), "id");
        
        //箱型
        XxinfoDTO xxinfoDTO = new XxinfoDTO();
        List<Integer> xxList = CollectionUtils
                .getBeanFieldValues(shmxList, "xx");
        xxinfoDTO.setIdList(xxList);
        Map<Integer, XxinfoModel> xxMap = CollectionUtils
                .toMap(xxinfoModelMapper.getList(xxinfoDTO), "id");
        
        //港口
        GkinfoDTO gkinfoDTO = new GkinfoDTO();
        List<Integer> gkList = CollectionUtils
                .getBeanFieldValues(shmxList, "cbdg","cblg");
        gkinfoDTO.setIdList(gkList);
        Map<Integer, GkinfoModel> gkMap = CollectionUtils
                .toMap(gkinfoModelMapper.getList(gkinfoDTO), "id");
        
        //站点
        ZdinfoDTO zdinfoDTO = new ZdinfoDTO();
        List<Integer> zdList = CollectionUtils
                .getBeanFieldValues(shmxList, "fz","dz");
        zdinfoDTO.setIdList(zdList);
        Map<Integer, ZdinfoModel> zdMap = CollectionUtils
                .toMap(zdinfoModelMapper.getList(zdinfoDTO), "id");

        SbmxinfoVO sbmxinfoVO = null;
        HwlxinfoVO hwlxinfoVO = null;
        XxinfoVO xxinfoVO = null;
        GkinfoVO cbdginfoVO = null;
        GkinfoVO cblginfoVO = null;
        ZdinfoVO fzinfoVO = null;
        ZdinfoVO dzinfoVO = null;

        for (SbmxinfoModel sbmxinfoModel : shmxList) {
        	sbmxinfoVO = new SbmxinfoVO();
            BeanUtils.copyProperties(sbmxinfoModel, sbmxinfoVO);
            //货物类型
            if (hwlxMap != null && !hwlxMap.isEmpty() && hwlxMap
                    .containsKey(sbmxinfoModel.getHwlx())) {
            	hwlxinfoVO = new HwlxinfoVO();
                BeanUtils.copyProperties(hwlxMap.get(sbmxinfoModel.getHwlx()),
                		hwlxinfoVO);
                sbmxinfoVO.setHwlxinfoVO(hwlxinfoVO);
            }
            //箱型
            if (xxMap != null && !xxMap.isEmpty() && xxMap
                    .containsKey(sbmxinfoModel.getXx())) {
            	xxinfoVO = new XxinfoVO();
                BeanUtils.copyProperties(xxMap.get(sbmxinfoModel.getXx()),
                		xxinfoVO);
                sbmxinfoVO.setXxinfoVO(xxinfoVO);
            }
         	//港口
            if (gkMap != null && !gkMap.isEmpty() && gkMap
                    .containsKey(sbmxinfoModel.getCbdg()) && gkMap
                    .containsKey(sbmxinfoModel.getCblg())) {
            	cbdginfoVO = new GkinfoVO();
            	cblginfoVO = new GkinfoVO();
                BeanUtils.copyProperties(gkMap.get(sbmxinfoModel.getCbdg()),
                		cbdginfoVO);
                BeanUtils.copyProperties(gkMap.get(sbmxinfoModel.getCblg()),
                		cblginfoVO);
                sbmxinfoVO.setCbdginfoVO(cbdginfoVO);
                sbmxinfoVO.setCblginfoVO(cblginfoVO);
            }
            //站点
            if (zdMap != null && !zdMap.isEmpty() && zdMap
                    .containsKey(sbmxinfoModel.getFz()) && zdMap
                    .containsKey(sbmxinfoModel.getDz())) {
            	fzinfoVO = new ZdinfoVO();
            	dzinfoVO = new ZdinfoVO();
                BeanUtils.copyProperties(zdMap.get(sbmxinfoModel.getFz()),
                		fzinfoVO);
                BeanUtils.copyProperties(zdMap.get(sbmxinfoModel.getDz()),
                		dzinfoVO);
                sbmxinfoVO.setFzinfoVO(fzinfoVO);
                sbmxinfoVO.setDzinfoVO(dzinfoVO);
            }
            voList.add(sbmxinfoVO);
        }
        return voList;
    }
    
    /**
     * 查询相同提单号和货票号列表
     *
     * @param SbhzinfoDTO
     * @return
     * @throws Exception
     */
    public Pagination<SbmxinfoVO> getSameDhList(SbmxinfoDTO sbmxinfoDTO)throws Exception {
		
    	Pagination<SbmxinfoVO> pagination = new Pagination<SbmxinfoVO>();
    	
    	int rowstartindex = (sbmxinfoDTO.getPage()-1)*sbmxinfoDTO.getRows();
    	sbmxinfoDTO.setRowstartindex(rowstartindex);
    	
    	List<SbmxinfoVO> voList = new ArrayList<SbmxinfoVO>();
        List<SbmxinfoModel> shmxList = sbmxinfoModelMapper.getSameDhList(sbmxinfoDTO);
        if (shmxList.isEmpty()) {
        	pagination.setRows(new ArrayList<SbmxinfoVO>());
        	pagination.setTotal(0);
            return pagination;
        }
        //货物类型
        HwlxinfoDTO hwlxDTO = new HwlxinfoDTO();
        List<Integer> hwlxList = CollectionUtils
                .getBeanFieldValues(shmxList, "hwlx");
        hwlxDTO.setIdList(hwlxList);
        Map<Integer, HwlxinfoModel> hwlxMap = CollectionUtils
                .toMap(hwlxinfoModelMapper.getList(hwlxDTO), "id");
        
        //箱型
        XxinfoDTO xxinfoDTO = new XxinfoDTO();
        List<Integer> xxList = CollectionUtils
                .getBeanFieldValues(shmxList, "xx");
        xxinfoDTO.setIdList(xxList);
        Map<Integer, XxinfoModel> xxMap = CollectionUtils
                .toMap(xxinfoModelMapper.getList(xxinfoDTO), "id");
        
        //港口
        GkinfoDTO gkinfoDTO = new GkinfoDTO();
        List<Integer> gkList = CollectionUtils
                .getBeanFieldValues(shmxList, "cbdg","cblg");
        gkinfoDTO.setIdList(gkList);
        Map<Integer, GkinfoModel> gkMap = CollectionUtils
                .toMap(gkinfoModelMapper.getList(gkinfoDTO), "id");
        
        //站点
        ZdinfoDTO zdinfoDTO = new ZdinfoDTO();
        List<Integer> zdList = CollectionUtils
                .getBeanFieldValues(shmxList, "fz","dz");
        zdinfoDTO.setIdList(zdList);
        Map<Integer, ZdinfoModel> zdMap = CollectionUtils
                .toMap(zdinfoModelMapper.getList(zdinfoDTO), "id");

        SbmxinfoVO sbmxinfoVO = null;
        HwlxinfoVO hwlxinfoVO = null;
        XxinfoVO xxinfoVO = null;
        GkinfoVO cbdginfoVO = null;
        GkinfoVO cblginfoVO = null;
        ZdinfoVO fzinfoVO = null;
        ZdinfoVO dzinfoVO = null;

        for (SbmxinfoModel sbmxinfoModel : shmxList) {
        	sbmxinfoVO = new SbmxinfoVO();
            BeanUtils.copyProperties(sbmxinfoModel, sbmxinfoVO);
            //货物类型
            if (hwlxMap != null && !hwlxMap.isEmpty() && hwlxMap
                    .containsKey(sbmxinfoModel.getHwlx())) {
            	hwlxinfoVO = new HwlxinfoVO();
                BeanUtils.copyProperties(hwlxMap.get(sbmxinfoModel.getHwlx()),
                		hwlxinfoVO);
                sbmxinfoVO.setHwlxinfoVO(hwlxinfoVO);
            }
            //箱型
            if (xxMap != null && !xxMap.isEmpty() && xxMap
                    .containsKey(sbmxinfoModel.getXx())) {
            	xxinfoVO = new XxinfoVO();
                BeanUtils.copyProperties(xxMap.get(sbmxinfoModel.getXx()),
                		xxinfoVO);
                sbmxinfoVO.setXxinfoVO(xxinfoVO);
            }
         	//港口
            if (gkMap != null && !gkMap.isEmpty() && gkMap
                    .containsKey(sbmxinfoModel.getCbdg()) && gkMap
                    .containsKey(sbmxinfoModel.getCblg())) {
            	cbdginfoVO = new GkinfoVO();
            	cblginfoVO = new GkinfoVO();
                BeanUtils.copyProperties(gkMap.get(sbmxinfoModel.getCbdg()),
                		cbdginfoVO);
                BeanUtils.copyProperties(gkMap.get(sbmxinfoModel.getCblg()),
                		cblginfoVO);
                sbmxinfoVO.setCbdginfoVO(cbdginfoVO);
                sbmxinfoVO.setCblginfoVO(cblginfoVO);
            }
            //站点
            if (zdMap != null && !zdMap.isEmpty() && zdMap
                    .containsKey(sbmxinfoModel.getFz()) && zdMap
                    .containsKey(sbmxinfoModel.getDz())) {
            	fzinfoVO = new ZdinfoVO();
            	dzinfoVO = new ZdinfoVO();
                BeanUtils.copyProperties(zdMap.get(sbmxinfoModel.getFz()),
                		fzinfoVO);
                BeanUtils.copyProperties(zdMap.get(sbmxinfoModel.getDz()),
                		dzinfoVO);
                sbmxinfoVO.setFzinfoVO(fzinfoVO);
                sbmxinfoVO.setDzinfoVO(dzinfoVO);
            }
            voList.add(sbmxinfoVO);
        }
        pagination.setRows(voList);
        pagination.setTotal(sbmxinfoModelMapper.getSameDhListCount(sbmxinfoDTO));
        return pagination;
	}
    
    /**
     * 明细质疑，更新汇总和明细为不通过
     *
     * @param SbmxinfoDTO
     * @return
     * @throws Exception
     */
    public void mxzy(SbmxinfoDTO sbmxinfoDTO)throws Exception {
    	
    	//List<String> hzdhlist = new ArrayList<String>();
    	String zy = sbmxinfoDTO.getJjyy();
    	
    	sbmxinfoDTO.setJjyy("");
    	List<SbmxinfoModel> list = sbmxinfoModelMapper.getList(sbmxinfoDTO);
    	for (SbmxinfoModel sbmxinfoModel : list) {
    		sbmxinfoModel.setIshc(2);
			sbmxinfoModel.setJjyy(zy);
			sbmxinfoModel.setGxsj(new Date());
			sbmxinfoModelMapper.updateByPrimaryKey(sbmxinfoModel);
			
//			if (!hzdhlist.contains(sbmxinfoModel.getHzdh())) {
//				hzdhlist.add(sbmxinfoModel.getHzdh());
//			}
		}
    	
    	/*SbhzinfoDTO sbhzinfoDTO = null;
    	for (String hzdh : hzdhlist) {
    		sbhzinfoDTO = new SbhzinfoDTO();
    		sbhzinfoDTO.setHzdh(hzdh);
    		SbhzinfoModel sbhzinfoModel = sbhzinfoModelMapper.getOne(sbhzinfoDTO);
    		if (sbhzinfoModel!=null) {
    			sbhzinfoModel.setHzzt(4);
    			sbhzinfoModel.setGxsj(new Date());
    			sbhzinfoModelMapper.updateByPrimaryKey(sbhzinfoModel);
			}
		}*/
	}
    
    /**
     * 获得统计TEU
     * @param SbmxinfoDTO
     * @return
     * @throws Exception
     */
	public Integer getStatisticsXLList(SbmxinfoDTO sbmxinfoDTO)throws Exception{
		return sbmxinfoModelMapper.getStatisticsXLList(sbmxinfoDTO);
	}
	
	public List<SbmxinfoVO> queryList(SbmxinfoDTO sbmxinfoDTO) throws Exception {
        List<SbmxinfoVO> voList = new ArrayList<SbmxinfoVO>();
        List<SbmxinfoModel> shmxList = getMapper().getList(sbmxinfoDTO);
        if (shmxList.isEmpty()) {
            return voList;
        }
        
        //用户
        SbhzinfoDTO sbhzinfoDTO = new SbhzinfoDTO();
        sbhzinfoDTO.setHzdh(shmxList.get(0).getHzdh());
        SbhzinfoModel sbhzinfoModel = sbhzinfoModelMapper.getOne(sbhzinfoDTO);
        String qyqc = yhxxModelMapper.getOne(new YhxxDTO(sbhzinfoModel.getYhid())).getQyqc();
        Integer sbnf = sbhzinfoModel.getSbnf();
        Integer sbjd = sbhzinfoModel.getSbjd();
        
        //货物类型
        HwlxinfoDTO hwlxDTO = new HwlxinfoDTO();
        List<Integer> hwlxList = CollectionUtils
                .getBeanFieldValues(shmxList, "hwlx");
        hwlxDTO.setIdList(hwlxList);
        Map<Integer, HwlxinfoModel> hwlxMap = CollectionUtils
                .toMap(hwlxinfoModelMapper.getList(hwlxDTO), "id");
        
        //箱型
        XxinfoDTO xxinfoDTO = new XxinfoDTO();
        List<Integer> xxList = CollectionUtils
                .getBeanFieldValues(shmxList, "xx");
        xxinfoDTO.setIdList(xxList);
        Map<Integer, XxinfoModel> xxMap = CollectionUtils
                .toMap(xxinfoModelMapper.getList(xxinfoDTO), "id");
        
        //港口
        GkinfoDTO gkinfoDTO = new GkinfoDTO();
        List<Integer> gkList = CollectionUtils
                .getBeanFieldValues(shmxList, "cbdg","cblg");
        gkinfoDTO.setIdList(gkList);
        Map<Integer, GkinfoModel> gkMap = CollectionUtils
                .toMap(gkinfoModelMapper.getList(gkinfoDTO), "id");
        
        //站点
        ZdinfoDTO zdinfoDTO = new ZdinfoDTO();
        List<Integer> zdList = CollectionUtils
                .getBeanFieldValues(shmxList, "fz","dz");
        zdinfoDTO.setIdList(zdList);
        Map<Integer, ZdinfoModel> zdMap = CollectionUtils
                .toMap(zdinfoModelMapper.getList(zdinfoDTO), "id");

        SbmxinfoVO sbmxinfoVO = null;
        HwlxinfoVO hwlxinfoVO = null;
        XxinfoVO xxinfoVO = null;
        GkinfoVO cbdginfoVO = null;
        GkinfoVO cblginfoVO = null;
        ZdinfoVO fzinfoVO = null;
        ZdinfoVO dzinfoVO = null;
        JzxtlinfoVO jzxtlinfoVO = null;
        JzxslinfoVO jzxslinfoVO = null;

        for (SbmxinfoModel sbmxinfoModel : shmxList) {
        	sbmxinfoVO = new SbmxinfoVO();
            BeanUtils.copyProperties(sbmxinfoModel, sbmxinfoVO);
       
            //企业名称 
            sbmxinfoVO.setQyqc(qyqc);
            
            //申报年份
            sbmxinfoVO.setSbnf(sbnf);
            
            //申报季度
            sbmxinfoVO.setSbjd(sbjd);
            
            //运输类型
            if (sbmxinfoVO.getYslx()==1) {
            	sbmxinfoVO.setYslxStr("铁水");
			}else {
				sbmxinfoVO.setYslxStr("水铁");
			}
            
            //贸易类型
            if (sbmxinfoVO.getMylx()==1) {
            	sbmxinfoVO.setMylxStr("内贸");
			}else {
				sbmxinfoVO.setMylxStr("外贸");
			}
            
            //货物类型
            if (hwlxMap != null && !hwlxMap.isEmpty() && hwlxMap
                    .containsKey(sbmxinfoModel.getHwlx())) {
            	hwlxinfoVO = new HwlxinfoVO();
                BeanUtils.copyProperties(hwlxMap.get(sbmxinfoModel.getHwlx()),
                		hwlxinfoVO);
                sbmxinfoVO.setHwlxinfoVO(hwlxinfoVO);
            }
            //箱型
            if (xxMap != null && !xxMap.isEmpty() && xxMap
                    .containsKey(sbmxinfoModel.getXx())) {
            	xxinfoVO = new XxinfoVO();
                BeanUtils.copyProperties(xxMap.get(sbmxinfoModel.getXx()),
                		xxinfoVO);
                sbmxinfoVO.setXxinfoVO(xxinfoVO);
            }
         	//港口
            if (gkMap != null && !gkMap.isEmpty() && gkMap
                    .containsKey(sbmxinfoModel.getCbdg()) && gkMap
                    .containsKey(sbmxinfoModel.getCblg())) {
            	cbdginfoVO = new GkinfoVO();
            	cblginfoVO = new GkinfoVO();
                BeanUtils.copyProperties(gkMap.get(sbmxinfoModel.getCbdg()),
                		cbdginfoVO);
                BeanUtils.copyProperties(gkMap.get(sbmxinfoModel.getCblg()),
                		cblginfoVO);
                sbmxinfoVO.setCbdginfoVO(cbdginfoVO);
                sbmxinfoVO.setCblginfoVO(cblginfoVO);
            }
            //站点
            if (zdMap != null && !zdMap.isEmpty() && zdMap
                    .containsKey(sbmxinfoModel.getFz()) && zdMap
                    .containsKey(sbmxinfoModel.getDz())) {
            	fzinfoVO = new ZdinfoVO();
            	dzinfoVO = new ZdinfoVO();
                BeanUtils.copyProperties(zdMap.get(sbmxinfoModel.getFz()),
                		fzinfoVO);
                BeanUtils.copyProperties(zdMap.get(sbmxinfoModel.getDz()),
                		dzinfoVO);
                sbmxinfoVO.setFzinfoVO(fzinfoVO);
                sbmxinfoVO.setDzinfoVO(dzinfoVO);
            }
            //货票附件
            JzxtlinfoDTO jzxtlinfoDTO = new JzxtlinfoDTO();
            jzxtlinfoDTO.setSfsc(0);
            jzxtlinfoDTO.setHph(sbmxinfoModel.getTlhph());
            JzxtlinfoModel jzxtlinfoModel = jzxtlinfoModelMapper.getOne(jzxtlinfoDTO);
            if (jzxtlinfoModel!=null) {
				jzxtlinfoVO = new JzxtlinfoVO();
				BeanUtils.copyProperties(jzxtlinfoModel,jzxtlinfoVO);
				sbmxinfoVO.setJzxtlinfoVO(jzxtlinfoVO);
			}
            //运单附件
            JzxslinfoDTO jzxslinfoDTO = new JzxslinfoDTO();
            jzxslinfoDTO.setSfsc(0);
            jzxslinfoDTO.setTdh(sbmxinfoModel.getHwydh());
            JzxslinfoModel jzxslinfoModel = jzxslinfoModelMapper.getOne(jzxslinfoDTO);
            if (jzxslinfoModel!=null) {
				jzxslinfoVO = new JzxslinfoVO();
				BeanUtils.copyProperties(jzxslinfoModel,jzxslinfoVO);
				sbmxinfoVO.setJzxslinfoVO(jzxslinfoVO);
			}
            
            voList.add(sbmxinfoVO);
        }
        
        return voList;
	}

	@Resource(name = "sbmxinfoModelMapper")
	private SbmxinfoModelMapper sbmxinfoModelMapper;
	
	@Resource(name = "sbhzinfoModelMapper")
	private SbhzinfoModelMapper sbhzinfoModelMapper;
	
	@Resource(name = "hwlxinfoModelMapper")
	private HwlxinfoModelMapper hwlxinfoModelMapper;
	
	@Resource(name = "xxinfoModelMapper")
	private XxinfoModelMapper xxinfoModelMapper;
	
	@Resource(name = "gkinfoModelMapper")
	private GkinfoModelMapper gkinfoModelMapper;
	
	@Resource(name = "zdinfoModelMapper")
	private ZdinfoModelMapper zdinfoModelMapper;
	
	@Resource(name = "jzxtlinfoModelMapper")
	private JzxtlinfoModelMapper jzxtlinfoModelMapper;
	
	@Resource(name = "jzxslinfoModelMapper")
	private JzxslinfoModelMapper jzxslinfoModelMapper;
	
	@Resource(name = "jzxhginfoModelMapper")
	private JzxhginfoModelMapper jzxhginfoModelMapper;
	
	@Resource(name = "yhxxModelMapper")
	private YhxxModelMapper yhxxModelMapper;
	
	@Override
	protected Mapper<SbmxinfoModel> getMapper() {
		return sbmxinfoModelMapper;
	}

}
